package facade.open.response.base;

import models.base.AdminBusiness;
import models.base.AdminUser;

import java.util.Date;

/**
 * created by weiwei on 2018-02-23
 * 业务、功能 返回信息
 */
public class AdminBusinessResponse {

    /**
     * id
     */
    public String id;


    /**
     * 业务编号
     */
    public String code;

    /**
     * 业务名称
     */
    public String name;

    /**
     * Controller名称
     */
    public String controller;


    /**
     * 页面请求地址
     */
    public String path;
    /**
     * 排序号
     */
    public Integer showOrder;

    public String remark;

    /**
     * 创建时间.
     */
    public Date createdAt;

    /**
     * 创建人.
     */
    public AdminUser createUser;


    /**
     * 更新时间.
     */
    public Date modifyAt;

    /**
     * 修改人.
     */
    public AdminUser modifyUser;



    public static AdminBusinessResponse from(AdminBusiness business){
        AdminBusinessResponse businessResponse = new AdminBusinessResponse();
        businessResponse.id = business.id ;
        businessResponse.code = business.code ;
        businessResponse.name = business.name ;
        businessResponse.controller = business.controller ;
        businessResponse.path = business.path ;
        businessResponse.showOrder = business.showOrder ;
        businessResponse.remark = business.remark ;
        businessResponse.createUser = business.createUser ;
        businessResponse.createdAt = business.createdAt ;
        businessResponse.modifyAt = business.modifyAt ;
        businessResponse.modifyUser = business.modifyUser ;
        return businessResponse ;

    }

}
